﻿///***************************************************************
/// 시  스  템 : Updms.Dvd.Dac
/// 단위시스템 : DVD
/// 계      층 : Data Access Layer
/// 프로그램명 : Dvd_Dac_UPDMS_DVD_INFO
/// 파  일  명 : Dvd_Dac_UPDMS_DVD_INFO.cs
/// 설      명 : DVD관리
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2008-08-04 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;


namespace Updms.Dvd.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Dvd_Dac_UPDMS_DVD_INFO : Base.AppFramework.DacBase
	{
		public Dvd_Dac_UPDMS_DVD_INFO()
		{
		}

		#region NT [GetSearchCount]
		
		[AutoComplete]
		public int GetSearchCount(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_DVD_INFO_Get_Search_Count";
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			
			return (int)_agent.ExecuteScalar(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [SelectProcess]
		
		[AutoComplete]
		public DataSet SelectProcess(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_DVD_INFO_Select_Paging";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_DVD_INFO", ds, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [GetCategoryListByDvdNo]

		[AutoComplete]
		public DataSet GetCategoryListByDvdNo(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_DVD_INFO_Get_Category_List_By_Dvd_No";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_DVD_INFO", ds, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [GetNewDvdNoByDiv]

		[AutoComplete]
		public string GetNewDvdNoByDiv(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_DVD_INFO_Get_New_Dvd_No_By_Div";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			return (string)_agent.ExecuteScalar(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [Insert]
		
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_DVD_INFO_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Update]
		
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_DVD_INFO_Update";			
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Delete]
		
		[AutoComplete]
		public int Delete(string ls_xml)
		{
			string strSql = "usp_UPDMS_DVD_INFO_Delete";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};
			
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [DeleteAttachFile]

		[AutoComplete]
		public int DeleteAttachFile(string ls_seq)
		{
			string strSql = "usp_UPDMS_DVD_INFO_Delete_Attach_File";

			SqlParameter[] paramArray =
			{
				new SqlParameter("Seq", ls_seq)
			};

			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [InsertCategory]

		[AutoComplete]
		public int InsertCategory(string ls_xml)
		{
			string strSql = "usp_UPDMS_DVD_CATEGORY_Insert_Xml";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};

			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion
	}
}
